import java.awt.*;
import java.awt.event.*;
 
public class PanelDemo {
    public static void main(String[] args) {
        Frame frame = new Frame("AWTDemo");
        frame.addWindowListener(new AdapterDemo());
        frame.setLayout(new FlowLayout());
        frame.setSize(200, 200);
         
        Panel panel = new Panel();
        panel.setBackground(Color.RED);
         
        frame.add(panel);
         
        frame.setVisible(true);
    }
}
 
class AdapterDemo extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }
}